﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DXApplicationTangche.UC.货号管理.service;
using DXApplicationTangche.UC.项目成果管理.service;

namespace DXApplicationTangche.UC.货号管理.成衣异常
{
    public partial class Form成衣异常放行 : DevExpress.XtraEditors.XtraForm
    {
        private String id { get; set; }
        public Form成衣异常放行(String id)
        {
            InitializeComponent();
            this.id = id;
        }

        private void textBox扫描_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)
            {
                if (String.IsNullOrEmpty(this.textBox扫描.Text))
                {
                    MessageBox.Show("无扫描信息");
                    return;
                }
                //判断扫描的工牌是否正确
                String mnemonic = 项目成果Service.get判断扫描员工码是否正确(this.textBox扫描.Text.Trim());
                if (String.IsNullOrWhiteSpace(mnemonic))
                {
                    this.textBox扫描.Clear();
                    MessageBox.Show("扫描员工码错误，请重新扫描");
                    return;
                }
                try
                {
                    成衣异常Service.solveGarmentExceptionLog(this.id, mnemonic);
                    this.Close();
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.Message);
                }
            }
        }
    }
}